import re

word ='ab128cd347820ef3233ab34x'
# print(word.index('7'))

# + 表示匹配1次或无限次，重复在+号之前的字符
# ? 匹配0次或1次，重复在?号之前的字符


# result = re.search(r'3\d', word)
# result = re.search(r'3\d+', word)
# result = re.search(r'3\d?', word)
# result = re.search(r'3\d{3}', word)
# print(result)

# match是从字符串的开始匹配的
# result = re.match(r'3\d+',word)
# result = re.match(r'ab\d+',word)
# result = re.fullmatch(r'ab\d+',word)

# print(re.fullmatch(r'ab\d+', 'ab1234579'))

# result = re.finditer(r'3\d+', word)
#
# for i in result:
# 	print(i)

y = re.findall(r'3\d+', word)
print(y)
for i in y:
	print(i)

# print(result)

